<?
$tags = @count($data->tag->list);
if($data->tag->populars || $data->tag->shares):
?>
<div class="tabs">
    <div class="tabsMenu">
        <a name="popular"<?=$tags < TAG_MIN_LIMIT ? ' class="selected"' : ''?>><?=dgettext('tag','Popular Tags')?></a>
        <a name="talking"<?=$tags >= TAG_MIN_LIMIT ? ' class="selected"' : ''?>><?=dgettext('tag','Talking Tags')?></a>
    </div>
    <div id="popular" class="tabsContainer<?=$tags < TAG_MIN_LIMIT ? ' selected' : ''?>">
        <div id="tags" class="tagContainer">
            <? if($data->tag->populars) foreach($data->tag->populars as $i): ?>
            <span class="tag">
                <a class="name" href="/tag/<?=$i->tag?>"><?=$i->tag?></a>
                <a class="remove" href="javascript:pasteTag('<?=$i->ID?>','<?=$i->tag?>');">+</a>
            </span>
            <? endforeach; ?>
            <div class="clear"></div>
        </div>
    </div>
    <div id="talking" class="tabsContainer<?=$tags >= TAG_MIN_LIMIT ? ' selected' : ''?>">
        <div id="tagShares">
            <?
            if($data->tag->shares) foreach ($data->tag->shares as $i)
            include 'apps/tag/template/_share_item.html';
            ?>
        </div>
    </div>
    <div class="clear"></div>
</div>
<?endif;?>